"use strict";

class webInterface {
    constructor() {
        this.__gtcpk = require("gtcpk-be");
        this.__socket_module = require("socket_module");

        this.ServiceSystem = require('./bin/basic.js').ServiceSystem;
        this.vmSystem_baseInfo = require('./bin/basic.js').vmSystem_baseInfo;
        this.vmSystem_HostDetails_Info = require('./bin/basic.js').vmSystem_HostDetails_Info;
        this.vmSystem_softwareSetting = require('./bin/basic.js').vmSystem_softwareSetting;
        this.vmSystem_UI_ExtraResource = require('./bin/basic.js').vmSystem_UI_ExtraResource;
        this.vmSystem_ioData = require('./bin/basic.js').vmSystem_ioData;
        this.vmSystem_Logging = require('./bin/basic.js').vmSystem_Logging;
        this.vmSystem_scb = require('./bin/basic.js').vmSystem_scb;

        this.vmSystem_create = require('./bin/controls.js').vmSystem_create;
        this.vmSystem_modify = require('./bin/controls.js').vmSystem_modify;
        this.vmSystem_remove = require('./bin/controls.js').vmSystem_remove;
        this.vmSystem_start = require('./bin/controls.js').vmSystem_start;
        this.vmSystem_stop = require('./bin/controls.js').vmSystem_stop;

        this.AccessConfig = {Address: "localhost", Port: 8080};

        this.__confirmReadyStatus = require("./bin/tools.js").confirmReadyStatus;
        this.__detectData = require("./bin/tools.js").detectData;
        this.__importProFileCheck = require("./bin/tools.js").importProFileCheck;
        this.__preDataDetect = require("./bin/tools.js").preDataDetect;
        this.__pathProcess = require("./bin/tools.js").pathProcess;
        this.__stopDelay = require("./bin/tools.js").stopDelay;
        this.__firmwareCheck = require("./bin/tools.js").firmwareCheck;
        this.__softwareDetectDataCheck = require("./bin/tools.js").softwareDetectDataCheck;
        this.__downloadResponseHeaderInfo = require("./bin/tools.js").downloadResponseHeaderInfo;

        this.__FirstInitial = require("./bin/task.js").FirstInitial;
        this.__afterProcess = require("./bin/task.js").afterProcess;
        this.__preData = require("./bin/task.js").preData;
        this.__vm_updateHostData = require("./bin/task.js").vm_updateHostData;
        this.__vm_softwareDetectPreData = require("./bin/task.js").softwareDetectPreData;
        this.__vm_logging_controls = require("./bin/task.js").vm_logging_controls;

        this.__vm_GenTools = new this.__gtcpk();
        this.__vm_SocketConnction = new this.__socket_module({mode: "middleware"});
        this.__vm_GenTools.DataTypeDetect({
            _GlobalOperate: {
                enableDict: true, bind: {
                    String: {aliasVal: "str", aliasDsc: "为字符串类型"},
                    Array: {aliasVal: "arr", aliasDsc: "为数组类型"},
                    Object: {aliasVal: "obj", aliasDsc: "为对象类型"},
                    Boolean: {aliasVal: "boo", aliasDsc: "为布尔类型"},
                    Number: {aliasVal: "num", aliasDsc: "为数字类型"},
                    Undefined: {aliasVal: "und", aliasDsc: "未知定义类型"},
                    Function: {aliasVal: "fun", aliasDsc: "为函数类型"},
                    AsyncFunction: {aliasVal: "anf", aliasDsc: "为异步函数类型"},
                    Null: {aliasVal: "nul", aliasDsc: "为空数据类型"},
                    process: {aliasVal: "pro", aliasDsc: "Node JS Process对象"},
                    Promise: {aliasVal: "pme", aliasDsc: "Node JS Promise对象"}
                }, RetValueType: 0
            }
        });
        this.__vm_MachinePath = "";
        this.__vm_softwareDetectList = [];
        this.__vm_existHost = [];
        this.__vm_framework = [];
        this.__vm_SupportOsList = [];
        this.__vm_HostPlatform = process.platform;
        this.__vm_ProgramPath = __dirname;
        this.__vm_logging_Area = [];
        this.__vm_firmware = [];
        this.__vm_configObject = class {
            Tips = "Do not edit this file and do not manipulate it in any way. This 'config. json' file is generated by the virtual machine software.";
            vm_MachinePath = "";
            vm_HostPlatform = "";
            vm_DefaultMachinePath = "";
            vm_SoftwareLanguage = "zh-cn";
            vm_SoftwareLanguageList = [];
            vm_AccessConfig = {Address: "localhost", Port: 8080};
            vm_DefaultAccessConfig = {Address: "localhost", Port: 8080};
        };
        this.__vm_frameworkObject = class {
            Tips = "This File is Not Allowed to Be Edited. If This File is Modified Or Changed, Unpredictable Errors will Occur in The Virtual Machine Software.";
            PlatformType = "";
            vm_Framework = [];
        };
        this.__vm_HostItemObject = class {
            name = "";
            id = "";
            path = "";
            framework = "";
            lastState = "close";
            pid = undefined;
        }
        this.__infoObject = class {
            FrameworkType = "";
            ProgramPath = "";
            HostType = [];
            CPUType = [];
            GPUType = [];
            Monitor = [];
            SoundHW = [];
            DeviceList = [];
            DriveOption = {
                if: ['ide', 'scsi', 'sd', 'mtd', 'floppy', 'pflash', 'virtio', 'none'],
                media: ['disk', 'cdrom'],
                cache: ['none', 'writeback', 'unsafe', 'directsync', 'writethrough'],
                aio: ["threads", "native", "io_uring"],
                format: ['raw', 'vdi', 'vhdx', 'vmdk']
            };
            UEFI_BIOS = [];
            AcceleratorsSupport = [];
            version = "";
        };
        this.__uefiObject = class {
            firmwareName = "";
            firmwareDesc = "";
            firmwareType = "";
            firmwarePath = [];
            firmwareId = "";
        };
        this.__vmObject = class {
            name = "";
            framework = "";
        };
        this.__devObject = class {
            name = "";
            bus = "";
            desc = "";
            alias = "";
        };
        this.__readyStatus = false;
        this.__readyReduce = 0;
        this.__delayStatus = false;
        this.__delayReduce = 0;
        this.__ExtraChildSystem = require("node:child_process");
    }
}

module.exports = webInterface;